package com.lsg.demo3.controller;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneOffset;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class Test {

    public static void main(String [] args){
        List<String> list  = new LinkedList<>();
        list.addAll(Arrays.asList("2", "3","4", "5"));
        Collections.reverse(list);
        System.out.println(list.isEmpty());
//        list.forEach(System.out::println);

        list.forEach(str ->{
//            System.out.println(str);
        });

//        for (String s : list) {
//            list.remove()
//        }
        for (int i = 0; i < list.size(); i++) {
            list.remove(i);
            System.out.println("删除节点后的list="+list);
        }

        //
        LocalDate localDate = LocalDate.now();
        LocalTime localTime = LocalTime.now();
        LocalDateTime localDateTime = LocalDateTime.now();
        System.out.println(localDate);
        System.out.println(localTime);
        System.out.println(localDateTime);

        System.out.println();

        //获取秒数
        Long second = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"));
        System.out.println(second);
        //获取毫秒数
        Long milliSecond = LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
        System.out.println(milliSecond);



        System.out.println(System.currentTimeMillis());



    }
}
